<?php
/***************************************************************
*  Copyright notice
*  (c) 2009, jianyuzhu@gmail.com
*  All rights reserved
*  This script is part of the PPEMI project.
***************************************************************/

//
if( $request_link_subclass != '' && $request_link_param['0'] != '' ) {
	$upload_filename = $request_link_subclass . '/' . $request_link_param['0'];
	$upload_file = CONFIG_PATH . CONFIG_DIR_UPLOADS_ORIGINS . $upload_filename;
	if( file_exists($upload_file) ) {
		include_once(CONFIG_PATH . CONFIG_DIR_CLASSES . 'lib.mime.class.php');
		$mimeObj = new LibMime();
		
		$upload_filetype = $mimeObj->getMimeType($upload_file);
		$upload_filesize = filesize($upload_file);
		
		//
		header('Content-Type: '.$upload_filetype);
		header('Content-Length: '.$upload_filesize);
		
		echo file_get_contents($upload_file);
	}
}
exit();
//
?>